package com.cyf.db.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * Created by cheyifu on 2018/2/6.
 */
public interface CityguidanceLedMapper {

    //根据led的id查找dtu的id
    @Select("select cd.`code` from cityguidance_led as cl,cityguidance_dtu as cd where cl.id = #{ledId} and cl.dtuId = cd.id;")
    String getDtuIdByLedId(@Param("ledId") int ledId);

    @Update("update cityguidance_led set carport = #{carport} where id = #{ledId}")
    void updateCarPort(@Param("ledId") int ledId,@Param("carport") int carport);
}
